package com.zlz.blog.server.config.login;

import com.zlz.blog.server.util.LoginUtil;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/**
 * @author wb_zhulinzhong
 * @date 2021-05-19 17:06:54
 */
@Configuration
public class LoginConfig implements WebMvcConfigurer {

    @Resource
    private LoginUtil loginUtil;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginHandlerInterceptor(loginUtil))
                .addPathPatterns("/**");
    }
}
